package app.ui.panels {
	import com.bit101.components.Label;
	import com.bit101.components.Panel;

	import org.osflash.signals.Signal;

	import flash.display.DisplayObjectContainer;

	/**
	 * @author Rendall
	 */
	public class AbstractBrowserPanel extends Panel implements IBrowserPanel {
		private var _stateChangeSignal : Signal;
		private var panelTitleLabel : Label;

		public function AbstractBrowserPanel(parent : DisplayObjectContainer = null, xpos : Number = 0, ypos : Number = 0) {
			super(parent, xpos, ypos);
		}

		protected function setTitle(title : String) : void {
			panelTitleLabel = new Label(this, 5, 5, title.toUpperCase());
			panelTitleLabel.autoSize = true;
			panelTitleLabel.textField.defaultTextFormat.size = 18;	
		}

		public function show(option : * = null) : void {
			this.visible = true;
		}

		public function hide(option : * = null) : void {
			this.visible = false;
		}

		public function get stateChangeSignal() : Signal {
			if (!_stateChangeSignal) _stateChangeSignal = new Signal();
			return _stateChangeSignal;
		}
	}
}
